package devil.pojo;

public final class Page
{
	public final static int DEFAULT_PAGE_NUMBER = 7;
	private final Integer currentPage, eachPageNumber;
	
	public Page(int currentPage)
	{
		this.currentPage = currentPage;
		this.eachPageNumber = DEFAULT_PAGE_NUMBER;
	}
	
	public Page(int currentPage, int eachPageNumber)
	{
		this.currentPage = currentPage;
		this.eachPageNumber = eachPageNumber;
	}
	
	public static Page getHomePage()
	{
		return new Page(1);
	}
	
	public int getFirstIndex()
	{
		return (currentPage - 1) * eachPageNumber;
	}
	
	public Integer getCurrentPage()
	{
		return currentPage;
	}
	
	public Integer getEachPageNumber()
	{
		return eachPageNumber;
	}
}
